class Notice {
  String id;
  String title;
  DateTime createTime;
  String content;
  bool read;

  Notice({this.id, this.title, this.createTime, this.read});

  factory Notice.fromJson(Map<String, dynamic> json) {
    return Notice(
      id: json['id'],
      title: json['title'],
      createTime: DateTime.parse(json['createTime']),
      read: json['read'],
    );
  }
}

class NoticeDetail {
  String id;
  String title;
  DateTime createTime;
  String content;

  NoticeDetail({this.id, this.title, this.createTime, this.content});

  factory NoticeDetail.fromJson(Map<String, dynamic> json) {
    return NoticeDetail(
      id: json['id'],
      title: json['title'],
      createTime: json['createTime'] == null ? null : DateTime.parse(json['createTime']),
      content: json['content'],
    );
  }
}
